package fr.cnam.projetSiw.client.core.mapper;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;

import fr.cnam.projetSiw.client.core.ClientFactory;
import fr.cnam.projetSiw.client.structure.HomePlace;
import fr.cnam.projetSiw.client.structure.pages.search.SearchActivity;

public class TopContentMapper implements ActivityMapper
{

private ClientFactory clientFactory;
	
	public TopContentMapper(ClientFactory clientFactory) 
	{
		this.clientFactory = clientFactory;
	}

	@Override
	public Activity getActivity(Place place) {
		if(place instanceof HomePlace)
		{
			return new SearchActivity(clientFactory);
		}
			
			
		return null;
	}

	public ClientFactory getClientFactory() {
		return clientFactory;
	}
}
